<template>
    <div class="report">
        <!-- <iframe class="iframes" src="http://61.240.138.156:336/Reports_WINCC/Pages/Report.aspx?ItemPath=%2f%e6%b5%8b%e8%af%95%e6%8a%a5%e8%a1%a8%e9%93%be%e6%8e%a520211124" frameborder="0"></iframe> -->
        <iframe class="iframes" :src="url" frameborder="0"></iframe>
    </div>
</template>

<script>

export default {
    data(){
        return {
            url:"",
            id:this.$route.params.id
        }
    },
    watch: {
        $route (to, from) {
            console.log(111)
            const item = this.$router.options.routes[0].children.find(item => item.path == '/reportForm')
            console.log(item)
            if(item && item.children){
                const el = item.children.find(item1 => item1.meta.index === parseInt(this.$route.params.id))
                if(el){
                    console.log(el)
                    this.url = el.meta.url
                }
            }
        }
    },
    created(){
        const item = this.$router.options.routes[0].children.find(item => item.path == '/reportForm')
        console.log(item)
        console.log(this.$route.params.id)
        if(item && item.children){
            const el = item.children.find(item1 => item1.meta.index === parseInt(this.$route.params.id))
            if(el){
                this.url = el.meta.url
            }
        }
    },
    methods:{

    },
    destroyed(){
        
    }
}
</script>
<style scoped>
    .iframes{
        width: 100%;
        height: calc(100vh - 60px);
    }
    .report{
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
    }
</style>